<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
    <h1>{{str}}</h1>
    <button @click="reStr">字符串翻转</button>
    </div>
  



   <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    <script>

    const v = new Vue({
            el:'#app',
            data:{
                str:'Hello World'
            },
            methods:{
                reStr(){
                  this.str = this.str.split('').reverse().join('')
                }
            }
        })
    </script>
</body>
</html>